#! /usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'xcma'


class MyException(Exception):

    def __init__(self, *args):
        self.args = args


# raise MyException('')

# 定义异常基类,然后在派生不同类型的异常

class loginError(MyException):
    def __init__(self, code=100, message='登录异常', args=('登录异常',)):
        self.args = args
        self.message = message
        self.code = code


class loginoutError(MyException):
    def __init__(self):
        self.args = ('退出异常',)
        self.message = '退出异常'
        self.code = 200

class respNotJson(MyException):
    def __init__(self, messages='response not json'):
        self.message = messages

    def __str__(self):
        return f"{self.message}"


